/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ids.dl;

import java.net.InetAddress;
import java.util.ArrayList;

/**
 *
 * @author Chartha Senarathne
 */
public class HeartBeat {
    
    public HeartBeat(ArrayList<IServer> servers)
    {
        this.initialServers = servers;
        existingServers = new ArrayList<HeartBeatData>();
        for (IServer server : servers) {
            existingServers.add(new HeartBeatData(server));
        }
    }
    
    private ArrayList<IServer> initialServers;
    
    private ArrayList<HeartBeatData> existingServers;

    /**
     * @return the initialServers
     */
    public ArrayList<IServer> getInitialServers() {
        return initialServers;
    }

    /**
     * @param initialServers the initialServers to set
     */
    public void setInitialServers(ArrayList<IServer> initialServers) {
        this.initialServers = initialServers;
    }

    /**
     * @return the existingServers
     */
    public ArrayList<HeartBeatData> getExistingServers() {
        return existingServers;
    }

    /**
     * @param existingServers the existingServers to set
     */
    public void setExistingServers(ArrayList<HeartBeatData> existingServers) {
        this.existingServers = existingServers;
    }
    
    public void addToExistingServers(Server server)
    {
        HeartBeatData hbd = new HeartBeatData(server);
        this.existingServers.add(hbd);
    }
    
    public void removeFromExistingServers(HeartBeatData hbd)
    {
        this.existingServers.remove(hbd);
    }
}
